python: Remove tab indents.
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 14 Jul 2009 13:43:19 +0000 (14:43 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 14 Jul 2009 13:43:19 +0000 (14:43 +0100)
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
tools/python/xen/web/SrvBase.py
tools/python/xen/web/SrvDir.py
tools/python/xen/xend/PrettyPrint.py
tools/python/xen/xend/XendConfig.py
tools/python/xen/xend/encode.py
tools/python/xen/xend/osdep.py
tools/python/xen/xend/server/pciquirk.py
tools/python/xen/xend/sxp.py
tools/python/xen/xm/create.py
tools/python/xen/xm/main.py

index bf59b556c868149351d3193db9a051bad6ae0494..cabb7b119f7e0ce93ed756747ab7d027368e43c7 100644 (file)
@@ -30,7 +30,7 @@ import httpserver
 
 def uri_pathlist(p):
     """Split a path into a list.
-    p          path
+    p path
     return list of path elements
     """
     l = []
@@ -51,7 +51,7 @@ class SrvBase(resource.Resource):
         """Get the method for an operation.
         For operation 'foo' looks for 'op_foo'.
 
-        op     operation name
+        op operation name
         returns method or None
         """
         op_method_name = 'op_' + op
@@ -67,7 +67,7 @@ class SrvBase(resource.Resource):
         and an HTML string otherwise (or list).
         Methods may also return a ThreadRequest (for incomplete processing).
 
-        req    request
+        req request
         """
         op = req.args.get('op')
         if op is None or len(op) != 1:
index 807da69b3a728181e494a6ff3f19516e836adef1..006975ef7997e7223a10465305c70cccae582e50 100644 (file)
@@ -37,7 +37,7 @@ class SrvConstructor:
         """Create a constructor. It is assumed that the class
         should be imported as 'from xen.xend.server.klass import klass'.
 
-        klass  name of its class
+        klass name of its class
         """
         self.klass = klass
         self.obj = None
index 48135771ac1de87179fc958c5df37afd583fcb74..22a78fb3f26d9e399c8814f310f5799c65752842 100644 (file)
@@ -284,9 +284,9 @@ class SXPPrettyPrinter(PrettyPrinter):
 def prettyprint(sxpr, out=sys.stdout, width=80):
     """Prettyprint an SXP form.
 
-    sxpr       s-expression
-    out                destination
-    width      maximum output width
+    sxpr  s-expression
+    out   destination
+    width maximum output width
     """
     if isinstance(sxpr, types.ListType):
         pp = SXPPrettyPrinter(width=width)
@@ -299,8 +299,8 @@ def prettyprint(sxpr, out=sys.stdout, width=80):
 def prettyprintstring(sxpr, width=80):
     """Prettyprint an SXP form to a string.
 
-    sxpr       s-expression
-    width      maximum output width
+    sxpr  s-expression
+    width maximum output width
     """
     io = StringIO.StringIO()
     prettyprint(sxpr, out=io, width=width)
index 3784b36553d1e6f50d15e79c928cb13dc508ab86..0871d9ac8ab2ab26f80aa5d6a5d7a681e08d669e 100644 (file)
@@ -1437,20 +1437,20 @@ class XendConfig(dict):
                 if dev_uuid not in target['console_refs']:
                     target['console_refs'].append(dev_uuid)
 
-               # Cope with old-format save files which say under vfb
-               # (type vfb) rather than (vfb 1)
-               try:
-                   vfb_type = dev_info['type']
-               except KeyError:
-                   vfb_type = None
-               log.debug("iwj dev_type=%s vfb type %s" %
-                       (dev_type, `vfb_type`))
-
-               if vfb_type == 'vnc' or vfb_type == 'sdl':
-                   dev_info[vfb_type] = 1
-                   del dev_info['type']
-                   log.debug("iwj dev_type=%s vfb setting dev_info['%s']" %
-                               (dev_type, vfb_type))
+                # Cope with old-format save files which say under vfb
+                # (type vfb) rather than (vfb 1)
+                try:
+                    vfb_type = dev_info['type']
+                except KeyError:
+                    vfb_type = None
+                log.debug("iwj dev_type=%s vfb type %s" %
+                          (dev_type, `vfb_type`))
+
+                if vfb_type == 'vnc' or vfb_type == 'sdl':
+                    dev_info[vfb_type] = 1
+                    del dev_info['type']
+                    log.debug("iwj dev_type=%s vfb setting dev_info['%s']" %
+                              (dev_type, vfb_type))
                 # Create serial backends now, the location value is bogus, but does not matter
                 i=0
                 chardev=0
index 3e541b4d9f8ef6cd33b4bd789e99cd6341b816d9..f47c18a1be38f01e43585d6b29f4c207306359e3 100644 (file)
@@ -97,7 +97,7 @@ def encode_data(d):
     """Encode some data for HTTP transport.
     The encoding used is stored in 'Content-Type' in the headers.
 
-    d  data - sequence of tuples or dictionary
+    d data - sequence of tuples or dictionary
     returns a 2-tuple of the headers and the encoded data
     """
     val = ({}, None)
index ce611a2982359bb917aa368aa7b54a973e65fad8..5d5cea6fff36029fc0299228d52e297b39b73c39 100644 (file)
@@ -72,12 +72,11 @@ def _linux_balloon_stat_sysfs(label):
     return None
 
 def _linux_balloon_stat(label):
-       if os.access(PROC_XEN_BALLOON, os.F_OK):
-               return _linux_balloon_stat_proc(label)
-       elif os.access(SYSFS_XEN_MEMORY, os.F_OK):
-               return _linux_balloon_stat_sysfs(label)
-
-       return None
+    if os.access(PROC_XEN_BALLOON, os.F_OK):
+        return _linux_balloon_stat_proc(label)
+    elif os.access(SYSFS_XEN_MEMORY, os.F_OK):
+        return _linux_balloon_stat_sysfs(label)
+    return None
 
 def _solaris_balloon_stat(label):
     """Returns the value for the named label, or None if an error occurs."""
index 71e9410d8036e1cd832f9710a63687836b1add30..eda3d1d45933ed409251a91498944ff198795b94 100644 (file)
@@ -37,10 +37,10 @@ class PCIQuirk:
             if id.startswith(self.devid[:9]): # id's vendor and device ID match
                 skey = id.split(':')
                 size = len(skey)
-                if (size == 2):                # subvendor/subdevice not suplied
+                if (size == 2): # subvendor/subdevice not suplied
                     ret = True
                     break
-                elif (size == 4):      # check subvendor/subdevice
+                elif (size == 4): # check subvendor/subdevice
                     # check subvendor
                     subven = '%04x' % self.subvendor
                     if ((skey[2] != 'FFFF') and 
index a9e9adf17feaeddbf4fef0e3601f5ee7a4ff53ff..c5a2e2a9f3da0c95f4ff5bf6eadfd3796461b388 100644 (file)
@@ -730,7 +730,7 @@ def all_from_string(s):
 def parse(io):
     """Completely parse all input from 'io'.
 
-    io input file object
+    io input file object
     returns list of values, None if incomplete
     raises ParseError on parse error
     """
index beda32ad8975ef066a4f2fd24b545da411e28db6..6ee6b7010d514f7e160ce91488a74c929c829a0a 100644 (file)
@@ -367,7 +367,7 @@ gopts.var('vfb', val="vnc=1,sdl=1,vncunused=1,vncdisplay=N,vnclisten=ADDR,displa
           given DISPLAY and XAUTHORITY, which default to the current user's
           ones.  OpenGL will be used by default unless opengl is set to 0.
           keymap overrides the XendD configured default layout file.
-         Serial adds a second serial support to qemu.
+          Serial adds a second serial support to qemu.
           Monitor adds a backend for the stubdom monitor.""")
 
 gopts.var('vif', val="type=TYPE,mac=MAC,bridge=BRIDGE,ip=IPADDR,script=SCRIPT," + \
index 30b1ceff45ed646e8348bbea860e9bc211877f0d..e557429d3d6ca8f5434d9dd3f073c543b2538841 100644 (file)
@@ -1794,8 +1794,8 @@ def xm_console(args):
     for (k, v) in options:
         if k in ['-q', '--quiet']:
             quiet = True
-       elif k in ['-n', '--num']:
-           num = int(v[0])
+        elif k in ['-n', '--num']:
+            num = int(v[0])
         else:
             assert False
 
@@ -2227,15 +2227,15 @@ def xm_pci_list(args):
         return
 
     def f(x):
-       # The vfunc shouldn't be used for ordering if the vslot hasn't been
-       # assigned as the output looks odd beacuse the vfunc isn't reported
-       # but the (physical) function is.
-       if x['vdevfn'] & AUTO_PHP_SLOT:
-           vdevfn = AUTO_PHP_SLOT
-       else:
-           vdevfn = x['vdevfn']
-        return (vdevfn << 32) | \
-              PCI_BDF(x['domain'], x['bus'], x['slot'], x['func'])
+        # The vfunc shouldn't be used for ordering if the vslot hasn't been
+        # assigned as the output looks odd beacuse the vfunc isn't reported
+        # but the (physical) function is.
+        if x['vdevfn'] & AUTO_PHP_SLOT:
+            vdevfn = AUTO_PHP_SLOT
+        else:
+            vdevfn = x['vdevfn']
+            return (vdevfn << 32) | \
+                   PCI_BDF(x['domain'], x['bus'], x['slot'], x['func'])
     devs.sort(None, f)
 
     has_vdevfn = False
@@ -2561,7 +2561,7 @@ def xm_pci_attach(args):
             vslot = PCI_SLOT(vdevfn)
             for i in dev:
                 i['vdevfn'] = '0x%02x' % \
-                            PCI_DEVFN(vslot, PCI_FUNC(int(i['vdevfn'], 16)))
+                              PCI_DEVFN(vslot, PCI_FUNC(int(i['vdevfn'], 16)))
 
     for i in dev:
         xm_pci_attach_one(dom, i)